{% extends '::base.html.twig' %}

{% block title %}Lista subskrybentów{% endblock %}
 
{% block body %}
    
    {%block content %}
    <!-- content start -->
    <div class="well">
        <h1 class="heading">Subskrybenci w kampanii {{campaign.name}}</h1>
        <ul>
            <li>Wszystkich subskrybentów w kampanii <span class="badge">{{campaign.subscribers|length}}</span></li>
        </ul>
        <a class="btn btn-primary btn-sm" href="{{path('wantuch_add_subscriber_campaign', {'_locale': g_locVar,'campaign_id':campaign.id})}}">Dodaj nowego subskrybenta</a>
        <table class="table table-striped table-hover ">
            <thead>
                <tr>
                    <th>ID</th>
                   
                    <th>Imię</th>
                    <th>Nazwisko</th>
                    <th>Email</th>
                    <th>Token</th>
                    <th>Aktywny</th>
                    <th>Szczegóły</th>
                    <th>Edycja</th>
                </tr>
            </thead>
            <tbody>
            {% for subscriber in campaign.subscribers %}
                <tr>
                    <td>{{subscriber.id}}</td>
                    
                    <td>{{subscriber.name}}</td>
                    <td>{{subscriber.surname}}</td>
                    <td>{{subscriber.email}}</td>
                    <td>{{subscriber.token[:3]}}...</td>
                    <td>{{subscriber.active}}</td>
                    <td><a href="#" class="show-details-modal" data-toggle="modal" data-target="#detailsModal">Pokaż</a></td>
                    <td><a href="{{path("wantuch_edit_subscriber",{'id':subscriber.id})}}">Edytuj</a></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        
    </div>
    <!-- Modal -->
    <div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="detailsModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only"></span></button>
                    <h4 class="modal-title" id="detailsModalLabel">Szczegóły kampanii</h4>
                </div>
                <div class="modal-body">
                    Witam, dziękuję za tę cenną informację. Mam pytanie czy muszę wcześniej zapłacić za te produkty czy mogę zamówić je z opcją pobrania?
                    <br /><br />
                    Wysłano od jan.kowalski@gmail.com
                    <a href="#" class="btn btn-sm btn-primary">Odpowiedz</a>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal" >Zamknij</button>
                </div>
            </div>
        </div>
    </div>
    <!-- End modal --> 
    <!-- content end -->
    {% endblock %}
    
    {% block footer %}{% endblock %}
{% endblock %} 